package com.itheima.app.manager;

import com.itheima.app.interceptor.UserHolder;
import com.itheima.service.mongo.UserLocationService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

@Controller
public class BaiduManager {
    @DubboReference
    private UserLocationService userLocationService;

    public ResponseEntity saveUpdateLocation(String longitude, String latitude, String addrStr) {
        userLocationService.saveOrUpdateLocation(longitude, latitude, addrStr, UserHolder.getLocalUserId());
        return ResponseEntity.ok(null);
    }
}
